<template>
  <!-- 角色管理 -->
  <div class="role">
    <!-- 面包屑导航 -->
    <el-bread></el-bread>
    <el-row>
      <el-button type="primary" plain @click="getdialog">添加</el-button>
    </el-row>
    <!-- 表格 -->
    <v-list @edit="edit"></v-list>
    <!-- dialog -->
    <v-dialog ref="diaInfo" @cancel="cancel" :isShow="isShow" :isAdd="isAdd"></v-dialog>
  </div>
</template>
  <script>
import vList from "./list.vue";
import vDialog from "./dialog.vue";
export default {
  data() {
    return {
      isShow: false,  //控制弹窗显示和隐藏
      isAdd: true,    //区分弹窗是添加还是编辑
    };
  },
  components: { vList, vDialog },
  computed: {},
  mounted() {},
  methods: {
    getdialog() {
      this.isShow = true;
      //告知你是一个添加按钮
      this.isAdd = true;
    },
    edit(e){
      this.isShow=true
      //告知你是一个编辑按钮
      this.isAdd=false
      this.$refs.diaInfo.lookup(e)
    },
    cancel(e){
      this.isShow = e
    }
  },
};
</script>
  <style lang="less" scoped>
</style>